/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.example.touch.communication.entities;

import java.util.ArrayList;
import java.util.Date;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;

/**
 *
 * @author krist_000
 */
@Root(name = "timetable")
public class TimeTable {
    
    @Attribute(name = "id")
    private String id;  
    
    @Element(name = "from")
    private Date from;
    
    @Element(name = "to")
    private Date to;    
    
    @ElementList(name = "days")
    private ArrayList<DayTime> days; 

     public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    
    public Date getFrom() {
        return from;
    }

    public void setFrom(Date from) {
        this.from = from;
    }

    public Date getTo() {
        return to;
    }

    public void setTo(Date to) {
        this.to = to;
    }


    public ArrayList<DayTime> getDays() {
        return days;
    }

    public void setDays(ArrayList<DayTime> days) {
        this.days = days;
    }
    
    @Override
    public String toString() {
        String str = "TimeTable: " + getId() + " from " + getFrom() + " to " + getTo() + "\n";
        for(DayTime day : getDays())
        {
            str += day.toString();
        }
        str += "\n";
        return str;
    }
    
    
}
